package simple.word;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class ExtraWordMapping {
	
	private String key;
	private List<String> candidates;
	
	public ExtraWordMapping() {
		
	}
	
	public ExtraWordMapping(String key, String... candidates) {
		this.key = key;
		this.candidates = new ArrayList<String>(Arrays.asList(candidates));
	}
	
	public ExtraWordMapping key(String k) {
		this.key = k;
		return this;
	}
	
	public ExtraWordMapping candidate(String c) {
		this.candidates.add(c);
		return this;
	}
	
	public List<String> getCandidates() {
		return candidates;
	}
	
	public String getKey() {
		return key;
	}
	
	public void putToMap(Map<String, ExtraWordMapping> map) {
		map.put(key, this);
	}

	@Override
	public String toString() {
		return "ExtraWordMapping [key=" + key + ", candidates=" + candidates
				+ "]";
	}	
	
}
